﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RiskMan.DataClass.AlfaDirectFolder
{
    /// <summary>
    /// ТАБЛИЦА «SUB_ACCOUNTS» - СПРАВОЧНИК ПОРТФЕЛЕЙ
    /// Ключевое поле: acc_code
    /// </summary>
    class SubAccounts : INotifyPropertyChanged
    {
        #region Private

        private string _accCode;
        private string _nickName;
        private int _treaty;
        private string _toy;
        private string _allowDebet;
        private string _fullName;


        #endregion

        #region Public

        /// <summary>
        /// Портфель.
        /// </summary>
        public string AccCode
        {
            get { return _accCode; }
            set
            {
                if (_accCode != value)
                    _accCode = value;

                RaisePropertyChanged("AccCode");
            }
        }
        /// <summary>
        /// Название портфеля.
        /// </summary>
        public string NickName
        {
            get { return _nickName; }
            set
            {
                if (_nickName != value)
                    _nickName = value;

                RaisePropertyChanged("NickName");
            }
        }
        /// <summary>
        /// Счет.
        /// </summary>
        public int Treaty
        {
            get { return _treaty; }
            set
            {
                if (_treaty != value)
                    _treaty = value;

                RaisePropertyChanged("Treaty");
            }
        }
        /// <summary>
        /// Игровой («Y» - да, «N» - нет).
        /// </summary>
        public string Toy
        {
            get { return _toy; }
            set
            {
                if (_toy != value)
                    _toy = value;

                RaisePropertyChanged("Toy");
            }
        }
        /// <summary>
        /// Маржинальный («Y» - да, «N» - нет).
        /// </summary>
        public string AllowDebet
        {
            get { return _allowDebet; }
            set
            {
                if (_allowDebet != value)
                    _allowDebet = value;

                RaisePropertyChanged("AllowDebet");
            }
        }
        /// <summary>
        /// Полное название счета.
        /// </summary>
        public string FullName
        {
            get { return _fullName; }
            set
            {
                if (_fullName != value)
                    _fullName = value;

                RaisePropertyChanged("FullName");
            }
        }

  

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
